package dryven.view.engine.parser.componentinvocation;

import dryven.view.ViewDataDictionary;
import dryven.view.engine.parser.ViewDataDeclarationCollection;

public class TextAttributeBinding implements
		AttributeBinding {

	private String _text;
	
	public TextAttributeBinding(String text) {
		super();
		_text = text;
	}

	@Override
	public Class<?> getBoundType() {
		return String.class;
	}

	@Override
	public Object getValue(ViewDataDictionary viewData) {
		return _text;
	}

	@Override
	public void compile(ViewDataDeclarationCollection declarations) {}

	@Override
	public Class<?> getBoundGenericType(int index) {
		return null;
	}

	/**
	 * The value of this attribute binding is not dependent
	 * of a ViewDataDictionary. If this method returns true
	 * it is ok to pass null to getValue.
	 */
	@Override
	public boolean isLiteral() {
		return true;
	}
}
